package com.carworld.utils.weixin;

import java.util.Date;

import com.carworld.utils.DateUtils;
import com.jfinal.weixin.sdk.api.ApiResult;
import com.jfinal.weixin.sdk.api.TemplateData;
import com.jfinal.weixin.sdk.api.TemplateMsgApi;

public class TemplateMessage {
	// 新会员加入通知
	public static final String NEW_MEMBER_JOIN = "Ypk9OnpGpfTn5q0x9ROvbqmIADMTBV8ANI-GoKvJjiU";
	// 购买成功通知
	public static final String PUECHASE_SUCCESS = "QyekX7ZpeBnJAsKZZr2KE_96-VBDfjxxHc4YEDRww7c";

	/**
	 * 新会员加入模板提醒
	 */
	public static void NewMemberJoin(String userOpenId, String newMemberName) {
		ApiResult apiResult = TemplateMsgApi.send(TemplateData.New().setTouser(userOpenId)
				.setTemplate_id(NEW_MEMBER_JOIN).add("first", "恭喜您，朋友 [" + newMemberName + "]通过您的分享成为新会员~")
				.add("keyword2", DateUtils.getCurrentTime(new Date()) + "\n", "#173177")
				.add("remark", "邀请的朋友消费即可有分红哦~", "#173177").build());
		System.out.println("新会员加入通知：" + apiResult.getJson());
	}

}
